class Solution:
    def clearDigits(self, s: str) -> str:
        d = []
        for c in s:
            if c.isdigit():
                d.pop()
            else:
                d.append(c)
        return ''.join(d)


if __name__ == '__main__':
    s = "cb34"
    so = Solution()

    print(so.clearDigits(s))
